package com.jk1.bianligou.blg.config;


import com.jk1.bianligou.blg.interceptor.LoginCheckInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author WHH
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Resource
    private LoginCheckInterceptor loginCheckInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry
                .addInterceptor(loginCheckInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/user/login","/user/register",
                        "/doc.html", "/favicon.ico", "/webjars/**", "/swagger-resources",
                        "/alipay/**");

    }

}
